﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using Pixysoft.Framework.Reflection.Controller;

namespace Pixysoft.Framework.Reflection.Core
{
    internal delegate void DynamicPropertySetHandler(object obj, object value, object[] index);

    internal delegate object DynamicPropertyGetHandler(object obj, object[] index);

    class DynamicPropertyInfo : IDynamicPropertyInfo
    {
        DynamicPropertySetHandler setHandler = null;

        DynamicPropertyGetHandler getHandler = null;

        public DynamicPropertyInfo(DynamicPropertySetHandler setHandler, DynamicPropertyGetHandler getHandler)
        {
            this.setHandler = setHandler;

            this.getHandler = getHandler;
        }

        public object GetValue(object obj, object[] index)
        {
            return this.getHandler(obj, index);
        }

        public void SetValue(object obj, object value, object[] index)
        {
            this.setHandler(obj, value, index);
        }
    }
}
